package com.kyzh.core.adapters.v3

import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.kyzh.core.pager.gamelist.*

class GameTopTabAdapter(val context: Fragment, val titles:ArrayList<String>): FragmentStateAdapter(context) {
    override fun getItemCount(): Int {
        return titles.size
    }

    override fun createFragment(position: Int): Fragment {
        return when(position){
            0-> SortNewFragment()
            1-> GMFragment()
            2-> GameRankFragment.newInstance(0)
            3-> GameRankFragment.newInstance(1)
            4-> GameYuYueFragment()
            5-> GameServerFragment()
            else-> SortNewFragment()
        }
    }

}